﻿using System.Windows.Controls;

namespace HomagChina.CCT.BaseUI.Views
{
    /// <summary>
    /// Home.xaml 的交互逻辑
    /// </summary>
    public partial class Home : UserControl
    {
        //private Popup _ispopup;

        //public Popup IsPopup
        //{ get => _ispopup; set { _ispopup = value; } }

        public Home()
        {
            InitializeComponent();
        }

        //    CreateImageCanvasView("s1", @"..\..\UIHelper\CanvasImage\OrdinaryRoller.png", 0, 150, 650, 250, 80);
        //    CreateImageCanvasView("s2", @"..\..\UIHelper\CanvasImage\BeltpulleySmall.png", 0, 158, 460, 250, 210);
        //    CreateImageCanvasView("s3", @"..\..\UIHelper\CanvasImage\OrdinaryRoller.png", 0, 145, 310, 250, 170);
        //    CreateImageCanvasView("s4", @"..\..\UIHelper\CanvasImage\BeltpulleyBig.png", 0, 150, 130, 250, 200);
        //    CreateImageCanvasView("H330", @"..\..\UIHelper\CanvasImage\H330.png", 0, 370, 65, 650, 330);
        //    CreateImageCanvasView("s5", @"..\..\UIHelper\CanvasImage\SupplementaryRoller.png", 0, 980, 150, 80, 160);
        //    CreateImageCanvasView("s6", @"..\..\UIHelper\CanvasImage\BeltpulleyBig.png", 0, 1050, 130, 250, 200);
        //    CreateImageCanvasView("s7", @"..\..\UIHelper\CanvasImage\OrdinaryRoller.png", 0, 1050, 310, 250, 170);
        //    CreateImageCanvasView("s8", @"..\..\UIHelper\CanvasImage\BeltpulleySmall.png", 0, 1065, 460, 250, 210);
        //    CreateImageCanvasView("s9", @"..\..\UIHelper\CanvasImage\OrdinaryRoller.png", 0, 1055, 650, 250, 80);
        //    CreateImageCanvasView("H230", @"..\..\UIHelper\CanvasImage\H230.png", 0, 370, 410, 750, 350);

        //    CreateSectionCanvasView(155, 650, "10");
        //    CreateSectionCanvasView(155, 490, "20");
        //    CreateSectionCanvasView(155, 320, "30");
        //    CreateSectionCanvasView(155, 250, "40");
        //    CreateSectionCanvasView(155, 170, "45");
        //    CreateSectionCanvasView(470, 170, "211");
        //    CreateSectionCanvasView(470, 250, "212");
        //    CreateSectionCanvasView(850, 170, "221");
        //    CreateSectionCanvasView(850, 250, "222");
        //    CreateSectionCanvasView(1260, 650, "100");
        //    CreateSectionCanvasView(1260, 490, "70");
        //    CreateSectionCanvasView(1260, 320, "60");
        //    CreateSectionCanvasView(1260, 250, "55");
        //    CreateSectionCanvasView(1260, 170, "50");
        //    CreateSectionCanvasView(500, 560, "111");
        //    CreateSectionCanvasView(930, 550, "121");

        //    CreateBoard(320, 685);//10
        //    CreateBoard(320, 550);//20
        //    CreateBoard(320, 410);//30
        //    CreateBoard(320, 260);//40
        //    CreateBoard(320, 180);//45
        //    CreateBoard(460, 260);//212
        //    CreateBoard(460, 180);//211
        //    CreateBoard(840, 260);//222
        //    CreateBoard(840, 180);//221
        //    CreateBoard(1080, 260);//55
        //    CreateBoard(1080, 180);//50
        //    CreateBoard(1080, 410);//60
        //    CreateBoard(1080, 550);//70
        //    CreateBoard(1080, 685);//100
        //    CreateBoard(490, 550);//111
        //    CreateBoard(920, 550);//121
        //}

        ////创建图片画布
        //public void CreateImageCanvasView(string Id, string imagePath, int strokeThickness, int left, int Top, int width, int height)
        //{
        //    Rectangle ImageRectangle = new Rectangle
        //    {
        //        Uid = Id,
        //        Width = width,
        //        Height = height,
        //        Fill = CraeteImageBrushFill(imagePath),
        //        Stroke = Brushes.Black,
        //        StrokeThickness = strokeThickness,
        //    };
        //    Canvas.SetLeft(ImageRectangle, left);
        //    Canvas.SetTop(ImageRectangle, Top);
        //    Warehouse.Children.Add(ImageRectangle);
        //}

        ////创建图片画布
        //public void CreateSectionCanvasView(int left, int Top, string text)
        //{
        //    var grid = new Grid();
        //    Ellipse container = new Ellipse
        //    {
        //        Width = 45,
        //        Height = 45,
        //        Fill = Brushes.White,
        //        Stroke = Brushes.Green,
        //        StrokeThickness = 3,
        //    };

        //    TextBlock textBlock = new TextBlock
        //    {
        //        Text = text,
        //        Foreground = Brushes.Green,
        //        Background = Brushes.White,
        //        FontSize = 17,
        //        FontWeight = FontWeights.Bold,
        //        HorizontalAlignment = HorizontalAlignment.Center,
        //        VerticalAlignment = VerticalAlignment.Center
        //    };
        //    grid.Children.Add(container);
        //    grid.Children.Add(textBlock);
        //    Canvas.SetLeft(grid, left);
        //    Canvas.SetTop(grid, Top);
        //    Canvas.SetZIndex(grid, 100000);
        //    Warehouse.Children.Add(grid);
        //}

        //public void CreateBoard(int let, int Top)
        //{
        //    Rectangle BoardRectangle = new Rectangle
        //    {
        //        Uid = "12312312",
        //        Width = 60,
        //        Height = 30,
        //        Fill = GetHexadecimalColor("#d5771e"),
        //        ToolTip = new TextBlock()
        //        {
        //            Text = "Reference:123123\nWidth:100\nHeight:40\nThickness:10",
        //            FontSize = 13,
        //            FontFamily = new FontFamily("Microsoft YaHei"),
        //            HorizontalAlignment = HorizontalAlignment.Center,
        //            VerticalAlignment = VerticalAlignment.Center
        //        }
        //};
        //    Canvas.SetLeft(BoardRectangle, let);
        //    Canvas.SetTop(BoardRectangle, Top);
        //    Canvas.SetZIndex(BoardRectangle, 10000);
        //    Warehouse.Children.Add(BoardRectangle);
        //}
    }
}